package com.tanhua.admin.service;

import cn.hutool.core.collection.CollUtil;
import com.tanhua.dubbo.api.MovementApi;
import com.tanhua.model.mongo.Movement;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.DubboReference;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service
public class ManagesService {

    @DubboReference
    private MovementApi movementApi;

    /**
     * 动态通过
     *
     * @param movementIds
     * @return
     */
    public ResponseEntity messagesPass(String movementIds) {
        movementApi.updateState(movementIds, 1);   //0未审， 1通过， 2驳回
        return ResponseEntity.status(200).body("动态审核通过");
    }


    /**
     * 动态拒绝
     *
     * @param movementIds
     * @return
     */
    public ResponseEntity messagesReject(String movementIds) {
        movementApi.updateState(movementIds, 2);   //0未审， 1通过， 2驳回
        return ResponseEntity.status(200).body("动态审核wei通过");
    }
}